package cn.dgut.testEvent;


import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 定义事件的监听器
 */
@Component
public class BlackListNotifier  {

    private String notificationAddress;

    public void setNotificationAddress(String notificationAddress) {
        this.notificationAddress = notificationAddress;
    }

    /**
     * 监听器对事件的处理
     */
    @EventListener
    public void processEvent(BlackListEvent event){
        System.out.println(event.getAddress());
        System.out.println(event.getContent());
    }

}
